package com.man.LogicService;

import com.man.bean.AdminMan;
import com.man.dao.AdminDao;

public class changepwdService {
    public static String authenticateUser(String account,String pwd,String pow){
        AdminMan peo = new AdminMan();
        peo.setAccount(account);
        peo.setPassword(pwd);
        peo.setPow(pow);
        if(account.equals("")){
            return "用户名不能为空";
        } else if (pwd.equals("")) {
            return "新密码不能为空";
        } else if (pow.equals("")) {
            return "权限不能为空";
        }
        int num=new AdminDao().changePwd(peo);
        if(num == 0){
            return "用户名与权限不对应";
        }else{
            return "修改密码成功";
        }
    }

}
